﻿Public Class list1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    'Function for turning the stars into asterisks or images
    ' Declare the function to get at stars as a number
    Protected Function getAge(ByVal age As Integer)

        'Declare the variable that will be returned
        Dim retval As String

        'Tell it that retval is equal to nothing
        retval = ""

        Select Case age
            Case Is < 20
                Return retval + "<img src='img/upto19.png'/>"
            Case Is < 30
                Return retval + "<img src='img/upto29.png'/>"
            Case Is < 40
                Return retval + "<img src='img/upto39.png'/>"
            Case Is < 50
                Return retval + "<img src='img/upto49.png'/>"
            Case Is < 60
                Return retval + "<img src='img/upto59.png'/>"
            Case Is > 59
                Return retval + "<img src='img/60plus.png'/>"
        End Select

        'Then return the varaible
        Return retval

    End Function

    'Function for turning the stars into asterisks or images
    ' Declare the function to get at stars as a number
    Protected Function getStars(ByVal stars As Integer)

        'Declare the variable that will be returned
        Dim retval As String

        'Tell it that retval is equal to nothing
        retval = ""

        'Loop for each number of stars 
        For i = 1 To stars
            'and for each one add an asterisk
            retval = retval + "<img src='img/cupcake.png' />"
        Next

        'Then return the varaible
        Return retval


        'Function for turning the stars into asterisks or images
        ' Declare the function to get at difficulty as a number

    End Function

    Protected Function getDifficulty(ByVal difficulty As Integer)

        'Declare the variable that will be returned
        Dim retval As String

        'Tell it that retval is equal to nothing
        retval = ""

        'Loop for each number of difficulty 
        For i = 1 To difficulty
            'and for each one add an asterisk
            retval = retval + "<img src='img/difficulty.png' />"
        Next

        'Then return the varaible
        Return retval


    End Function

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged
        Response.Redirect("cakeByTag.aspx?tag=" & DropDownList1.SelectedValue)
    End Sub

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged

    End Sub
End Class